import java.util.Random;
import java.util.Scanner;

public class CallName {
    public static void main(String[] args){
        System.out.println("Welcome to the CallName System!");
        String[] students = new String[3];
        addStudentsName(students); 
        printStudentName(students);
        String randomName = randomStudentName(students);
        System.out.println("Called student is:" + randomName);
    }
    public static void addStudentsName(String[] students){
        Scanner sc = new Scanner(System.in);
        for (int i = 0;i<students.length;i++){
            System.out.println("Now,you can input the name for student_" + (i+1));
            students[i] = sc.next();
        } 
    }
    public static  void printStudentName(String[] students){
        for (int i = 0;i<students.length;i++){
            System.out.println("The student_" + (i+1) + "named" + students[i]);
        }
    }
    public static String randomStudentName(String[] students){
        int index = new Random().nextInt(students.length);
        String name = students[index];
        return name; 
    }
}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       